#include "FLL_NXT_Navigation_Robot.h"

#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Reflection;
using namespace System::Security::Permissions;

extern FLL_NXT_Navigation_Robot robot1;

namespace test_thingey {

	/// <summary>
	/// Summary for AboutForm
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class AboutForm : public System::Windows::Forms::Form
	{
	public:
		AboutForm(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
			UpdateListBox();  //update the list box with all the desired information
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~AboutForm()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::ListBox^  listBoxAbout;
	private: System::Windows::Forms::Button^  buttonOK;

	protected: 

	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->listBoxAbout = (gcnew System::Windows::Forms::ListBox());
			this->buttonOK = (gcnew System::Windows::Forms::Button());
			this->SuspendLayout();
			// 
			// listBoxAbout
			// 
			this->listBoxAbout->FormattingEnabled = true;
			this->listBoxAbout->HorizontalScrollbar = true;
			this->listBoxAbout->Location = System::Drawing::Point(12, 12);
			this->listBoxAbout->Name = L"listBoxAbout";
			this->listBoxAbout->SelectionMode = System::Windows::Forms::SelectionMode::MultiSimple;
			this->listBoxAbout->Size = System::Drawing::Size(527, 225);
			this->listBoxAbout->TabIndex = 0;
			this->listBoxAbout->SelectedIndexChanged += gcnew System::EventHandler(this, &AboutForm::listBoxAbout_SelectedIndexChanged);
			// 
			// buttonOK
			// 
			this->buttonOK->DialogResult = System::Windows::Forms::DialogResult::OK;
			this->buttonOK->Location = System::Drawing::Point(464, 268);
			this->buttonOK->Name = L"buttonOK";
			this->buttonOK->Size = System::Drawing::Size(75, 23);
			this->buttonOK->TabIndex = 1;
			this->buttonOK->Text = L"OK";
			this->buttonOK->UseVisualStyleBackColor = true;
			// 
			// AboutForm
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(551, 319);
			this->Controls->Add(this->buttonOK);
			this->Controls->Add(this->listBoxAbout);
			this->Name = L"AboutForm";
			this->Text = L"About";
			this->Load += gcnew System::EventHandler(this, &AboutForm::AboutForm_Load);
			this->ResumeLayout(false);

		}
#pragma endregion
	private: System::Void listBoxAbout_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: void UpdateListBox() {
			//update the list box with all the desired information

			Assembly^ assem = Assembly::GetExecutingAssembly();
			
			listBoxAbout->Items->Add("Assembly Full Name:" + assem->FullName);

			// The AssemblyName type can be used to parse the full name.
			AssemblyName^ assemName = assem->GetName();
			listBoxAbout->Items->Add("Name: " + assemName->Name);

			listBoxAbout->Items->Add("Version: " + assemName->Version->Major +"," + assemName->Version->Minor);
			listBoxAbout->Items->Add("Revision: " + assemName->Version->Revision);
			listBoxAbout->Items->Add("Build Number: " + assemName->Version->Build);

			listBoxAbout->Items->Add("Assembly CodeBase: " + assem->CodeBase);

			listBoxAbout->Items->Add("");  //blank line for ease of reading
			listBoxAbout->Items->Add("Robot Calibrations:");
			listBoxAbout->Items->Add("WheelBase = " + robot1.WheelBase.ToString("0.000"));
			listBoxAbout->Items->Add("WheelTrack = " + robot1.WheelTrack.ToString("0.000"));
			listBoxAbout->Items->Add("WheelDiameter = " + robot1.WheelDiameter.ToString("0.000"));		
			listBoxAbout->Items->Add("RotationsPerInch = " + robot1.RotationsPerInch.ToString("0.000"));
			listBoxAbout->Items->Add("RotationsPerDegree = " + robot1.RotationsPerDegree.ToString("0.000"));

			 }

	private: System::Void AboutForm_Load(System::Object^  sender, System::EventArgs^  e) {
			 }
};
}
